package com.edu.entity;

import lombok.*;
import com.alibaba.fastjson2.annotation.JSONField;

import java.sql.Timestamp;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class CommentEntity {
    //用户评论
    private int commentId;

    private int userId;

    private int bookId;

    @JSONField(name = "content")
    private String content;

    @JSONField(name = "rating")
    private int rating;

    @JSONField(name = "createdAt", format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp commentDate;

    private String username;

    public CommentEntity(int commentId, int userId, int bookId, String content, int rating, Timestamp commentDate) {
        this.commentId = commentId;
        this.userId = userId;
        this.bookId = bookId;
        this.content = content;
        this.rating = rating;
        this.commentDate = commentDate;
    }
}